package com.yunchao.test.data.datasource

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.yunchao.test.data.datasource.model.MaintenanceInfoEntityModel

@Dao
internal interface MaintenanceInfoDao {


    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertMaintenanceInfo(list: List<MaintenanceInfoEntityModel>)


    @Query("SELECT * FROM maintenance_info where lockNo = :lockNo order by createTime desc limit 1")
    suspend fun getMaintenanceInfoByLockNo(lockNo: String): MaintenanceInfoEntityModel?

    @Query("SELECT * FROM maintenance_info WHERE lockNo IN (:lockNoList)")
   suspend fun getMaintenanceInfoByLockNoList(lockNoList: List<String>): List<MaintenanceInfoEntityModel>?
}